<?php
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webits.asia, developer@webits.asia
 * Created on:	Jan 23, 2009
 ^
 + Project: 		WRecruit
 * File Name:	views/employer/tmpl/myjobs.php
 ^ 
 * Description: template view for my jobs
 ^ 
 * History:		NONE
 ^ 
 */
 
 defined('_JEXEC') or die('Restricted access');
 
 global $mainframe;
 $document =& JFactory::getDocument();
 $document->addStyleSheet('components/com_wrecruit/css/'.$this->config['theme']);
    
?>

<?php if ($this->config['offline'] == '1'){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	<?php echo $this->config['title']; ?></td></tr>
	<tr><td height="25"></td></tr>
	<tr><td class="wrecruitmsg">
		<?php echo $this->config['offline_text']; ?>
	</td></tr>
</table>	
<?php }else{ ?>

<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	
		<?php echo $this->config['title']; ?>
	</td>
	</tr>
	<tr><td height="23"></td></tr>
	<?php if ($this->config['cur_location'] == 1) {?>
	<tr><td class="curloc">
		<?php echo JText::_('JS_CUR_LOC'); ?> : <a href="index.php?option=com_wrecruit&c=wrecruit&view=employer&layout=empmessages&Itemid=<?php echo $this->Itemid; ?>" class="curloclnk"><?php echo JText::_('JS_MESSAGES'); ?></a> > <?php echo JText::_('JS_JOB_MESSAGES'); ?>
	</td></tr>
	<?php } ?>
	<tr nowrap><td >
		<?php 
			if (sizeof($this->employerlinks) != 0){
				echo '<div id="toplinks"><ul>';
				foreach($this->employerlinks as $lnk)	{ ?>
					<span <?php if($lnk[2] == 1)echo 'class="first"'; elseif($lnk[2] == -1)echo 'class="last"';  ?>>
						<a href="<?php echo $lnk[0]; ?>"> <?php echo $lnk[1]; ?></a>
					</span>
				<?php }
				echo '<ul></div>';			
			}
		?>
	</td></tr>	
	<tr><td height="3"></td></tr>
	<tr><td class="<?php echo $this->theme['heading']; ?>" align="center">
		<?php echo JText::_('JS_JOB_MESSAGES'); ?>
	</td></tr>
	<tr><td height="3"></td></tr>
</table>


<?php
if ($this->userrole->rolefor == 1) { // employer

if(isset($this->messages)) {

?>

<form action="index.php" method="post" name="adminForm">
	<table cellpadding="0" cellspacing="0" border="0" width="100%" >
		
		<?php 
		$tdclass = array($this->theme['odd'], $this->theme['even']);
		$isodd =1;
		if ( isset($this->messages) ){?>
                    <tr>
                            <td width="30%">&nbsp;<strong><?php echo JText::_('JS_TITLE'); ?>	</strong></td>
                            <td width="30%" >&nbsp;<strong><?php echo JText::_('JS_JOB_SEEKER'); ?>	</strong></td>
                            <td width="20%" >&nbsp;<strong><?php echo JText::_('JS_RESUME'); ?>	</strong></td>
                            <td width="20%" >&nbsp;</td>
                    </tr>
                    <?php foreach($this->messages as $message)	{
                            $isodd = 1 - $isodd; ?>
                            <tr class="<?php echo $tdclass[$isodd]; ?>">
                                        <td >&nbsp;<?php echo $message->title;?></td>
                                        <td >&nbsp;<?php echo $message->first_name; if ($message->middle_name) echo ' '.$message->middle_name; echo ' '.$message->last_name; ?></td>
                                        <td >&nbsp;<?php echo $message->application_title;?></td>
                                            <td >&nbsp;
                                                    <?php $link = 'index.php?option=com_wrecruit&c=wrecruit&view=employer&layout=send_message&bd='.$message->jobid.'&rd='.$message->resumeid.'&vm=2&Itemid='.$this->Itemid; ?>
                                                    <a href="<?php echo $link?>" class="" title="<?php echo JText::_('JS_MESSAGES'); ?>">
                                                    <?php if ($message->unread > 0) echo '<strong>'.JText::_('JS_MESSAGES').' ['.$message->unread.']</strong>';
                                                        else echo JText::_('JS_MESSAGES'); ?>
                                                    </a>
                                                </td>
                            </tr>
                            <tr><td height="3"></td></tr>
                    <?php
                    }
		}?>		
	</table>
			<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
			<input type="hidden" name="task" value="deletejob" />
			<input type="hidden" id="id" name="id" value="" />
			<input type="hidden" name="boxchecked" value="0" />

	</form>

<form action="<?php echo JRoute::_('index.php?option=com_wrecruit&c=wrecruit&view=employer&layout=job_messages&bd='.$this->messages[0]->jobid.'&Itemid='.$this->Itemid); ?>" method="post">
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
    <tr>
        <td></td>
        <td >
            <?php
            echo $this->pagination->getPagesLinks();
            ?>
        </td>
    </tr>
    <tr>
        <td align="left">
            <?php echo JText::_('JS_DISPLAY_#'); ?>
            <?php
            echo $this->pagination->getLimitBox();
            ?>
        </td>
        <td align="right">
            <?php
            echo $this->pagination->getResultsCounter();
            ?>
        </td>
    </tr>
</table>
</form>	
<?php
}else{ // no result found in this category
	echo JText::_('JS_RESULT_NOT_FOUND');
}

} else{ // not allowed job posting
echo JText::_('JS_YOU_ARE_NOT_ALLOWED_TO_VIEW');
}	
}//ol
?>	
<div width="100%">
<?php 
if($this->config['fr_cr_txsh']) {
	echo 
	'<table width="100%" style="table-layout:fixed;">
		<tr><td height="15"></td></tr>
		<tr><td style="vertical-align:top;" align="center">'.$this->config['fr_cr_txa'].$this->config['fr_cr_txb'].'</td></tr>
	</table>';
}	
?>
</div>


